<?php
/*
* Author: Nguyen Hai Nam
* Module: NewsMediaDetailModule
* Desc	: Something news hot
* Date	: 24/06/2012
*/
class NewsMediaDetailModule extends Pick_Core_Module{
	
	function NewsMediaDetailModule(){
		
		parent::Pick_Core_Module();
		//$this->pushJS();
		//$this->pushCSS();
		# Languages
		$languages = new Pick_Core_Languages();
		$objectLanguages = "";
		$objectLanguages = $languages->getObjects(1, 'status = 1', array('position'=>'ASC'), '');
		if($objectLanguages){
			$objectLanguages = $objectLanguages['data'];	
		}#endif
		$this->template->assign("objectLanguages", $objectLanguages);
	}
	public function getContent(){

		$news = new Pick_Dao_News();
		$id = $this->request->get('id');
		if($id){
			$objNews = $news->getObject($id);
			if(is_object($objNews)){
				$cid = $objNews->getField('cid');
				$newsCategory = new Pick_Dao_NewsCategory();
				$objCat = $newsCategory->getObject($cid);
				$this->template->assign("objNews", $objNews);
				$this->template->assign("objCat", $objCat);
                $backgroundimage = $objNews->getFullUrlBackGround();
                $this->template->assign('backgroundimage', $backgroundimage);
			}
		}
		
		return "";
	}
}